var e = require("../../../../../@babel/runtime/helpers/regeneratorRuntime"),
  t = require("../../../../../@babel/runtime/helpers/asyncToGenerator"),
  r = require("../../../../../store/index"),
  a = require("../../../../../config/index"),
  i = require("../../../../../utils/index"),
  n = require("./util"),
  o = i.helper.listOperate;
Component({
  externalClasses: ["machine-card-class"],
  properties: {
    item: {
      type: Object,
      value: null
    },
    type: {
      type: String,
      value: ""
    },
    showTitleTag: {
      type: Boolean,
      value: !0
    },
    preventJump: {
      type: Boolean,
      value: !1
    }
  },
  observers: {
    "item.**": function () {
      this.getCardInfo()
    }
  },
  data: {
    cardItem: {}
  },
  methods: {
    getCardInfo: function () {
      var r = this;
      return t(e().mark((function t() {
        var a;
        return e().wrap((function (e) {
          for (;;) switch (e.prev = e.next) {
            case 0:
              a = r.data.item, "{}" !== JSON.stringify(a) && n.cleanCardData.call(r, a);
            case 2:
            case "end":
              return e.stop()
          }
        }), t)
      })))()
    },
    onMachineTap: function () {
      var e = this.data,
        t = e.item;
      if (e.preventJump) this.triggerEvent("machine", {
        row: t
      });
      else if (t.mode == a.typeMode.device) {
        var i = $.getCurrentPage(); - 1 == ["subpackage/device/details/index", "subpackage/common/details/index"].indexOf(i.route) && (0, r.dispatch)(r.actions.storageActions.removeItem("recommendMode")),console.log('------t-----'),console.log(t), $.router.push("/subpackage/device/details/index", {
          uuid: t.id,
          mode: t.mode
        })
      } else t.mode != a.typeMode.hire && t.mode != a.typeMode.sell || (0, r.dispatch)(r.actions.storageActions.setItem({
        key: "recommendMode",
        value: t.mode
      })), o.setHistoryList(t),console.log('-----t-----');
    }
  }
});